package day20171117;

import java.io.*;

public class Test {
    public static void main(String[] args) {
        String path = "E:\\hello.txt";
        BufferedWriter writer = null;

        try {
            writer= new BufferedWriter(new FileWriter(path));

            writer.write("Hello!");
            writer.newLine();


        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        FileOutputStream fileOutputStream = null ;

        try {
            fileOutputStream= new FileOutputStream(path);

            fileOutputStream.write(65);

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fileOutputStream.close();
            } catch (IOException e) {
            }
        }


    }
}
